﻿using MyMVC.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MyMVC.BLL
{
    public class EmployeeManager
    {
        EmployeeService es = new EmployeeService();

        /// <summary>
        /// 调用查询方法
        /// </summary>
        /// <returns></returns>
        public List<Employee> GetList()
        {
            return es.GetList();
        }

        /// <summary>
        /// 调用查询已删除信息方法
        /// </summary>
        /// <returns></returns>
        public List<Employee> GetList2()
        {
            return es.GetList2();
        }

        /// <summary>
        /// 调用假删除方法
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public bool del(int id)
        {
            return es.del(id) > 0;
        }

        /// <summary>
        /// 还原
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public bool huanyuan(int id)
        {
            return es.huanyuan(id) > 0;
        }

        /// <summary>
        /// 调用添加方法
        /// </summary>
        /// <param name="e"></param>
        /// <returns></returns>
        public bool add(Employee e, string u)
        {
            return es.add(e, u) > 0;
        }

        /// <summary>
        /// 调用修改信息方法
        /// </summary>
        /// <param name="emp">数据信息</param>
        /// <param name="u">图片路径</param>
        /// <param name="id">传的id</param>
        /// <returns></returns>
        public int update(Employee emp,string u,int id)
        {
            return es.update(emp, u,id);
        }

        /// <summary>
        /// 调用根据id查询数据信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public List<Employee> getlistid(int id)
        {
            return es.getlistid(id);
        }
    }
}
